import java.util.Scanner;
 
public class Lesson8 {
    public static void main(String[] args) {
        // 获取当前系统时间（毫秒）
        long systemTime = System.currentTimeMillis();
 
        // 计算总秒数及当前秒
        final int MILLI_TO_SECOND = 1000;
        long totalSeconds = systemTime / MILLI_TO_SECOND;
        long second = totalSeconds % 60;
 
        // 计算总分钟数及当前分钟
        final int SECOND_TO_MINUTE = 60;
        long totalMinutes = totalSeconds / SECOND_TO_MINUTE;
        long minute = totalMinutes % SECOND_TO_MINUTE;
 
        // 计算总小时数及GMT小时
        final int MINUTE_TO_HOUR = 60;
        long totalHours = totalMinutes / MINUTE_TO_HOUR;
        long gmtHour = totalHours % 24;
 
        // 用户输入时区偏移量
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter the time zone offset to GMT: ");
        int timezoneOffset = scanner.nextInt();
 
        // 计算目标时区的小时（处理负数情况）
        int localHour = (int)(gmtHour + timezoneOffset) % 24;
        if (localHour < 0) {
            localHour += 24;
        }
 
        // 格式化输出时间（补零优化）
        System.out.printf("The current time is %02d:%02d:%02d%n", localHour, minute, second);
 
        // 关闭Scanner资源
        scanner.close();
    }
}